import { useEffect } from "react"
import Router from "./router";
import { Provider } from "react-redux";
import store from "./store";
const keydownEvent = (e) => {
    // F12
    if (e.keyCode === 123) {
        console.log('---keydown-- f12');
        window.electron.switchDevTools()
    }
    // ctrl+r
    if (e.ctrlKey && e.keyCode === 82) {
        window.location.reload();
    }
}
const App = () => {
    useEffect(() => {
        window.addEventListener('keydown', keydownEvent)

        return () => {
            window.removeEventListener('keydown', keydownEvent)
        }
    }, [])

    return <Provider store={store}>
        <Router />
    </Provider>

}

export default App;